#include <jni.h>
#include <string>

// https://blog.csdn.net/wenzhi20102321/article/details/136700209

//默认的静态注册方法：
// public native String stringFromJNI()
extern "C" JNIEXPORT jstring JNICALL
Java_com_demo_jnistatic_MainActivity_stringFromJNI(JNIEnv* env, jobject /* this */) {
    std::string hello = "Hello from C++";
    return env->NewStringUTF(hello.c_str());
}

//public native int intFromJNI(int age);
extern "C" JNIEXPORT jint JNICALL Java_com_demo_jnistatic_MainActivity_intFromJNI(JNIEnv* env,
                                                                                  jobject thiz,
                                                                                  jint age) {
    return age + 10;
}
